#include <iostream>

using namespace std;

typedef long long LL;

int main()
{
	int n, v, m, a;
	cin >> n >> v >> m >> a;
	
	LL res = 0;
	
	for (int i = 1, cnt = 1; i <= n; i ++ , cnt ++ )
	{
		res += v;
		if (cnt % m == 0) v += a;
	}
	
	cout << res << endl;
	return 0;
}